<template>
  <div>
    <query-table ref="log_query_table" :columns="columns" :query-fields="queryFields" :detail-fields="infoFields" base-url="/sys_operate_log" show-index></query-table>
  </div>
</template>
<script>
export default {
  $$route:{
    meta:{
      title:'操作日志'
    }
  },
  name: "LogList",
  data() {
    return {

      //展示列信息
      columns: [
        {id: 'createUser', name: '操作人', width: 100,type:'user'},
        {id: 'companyId', name: '所属公司', width: 150,type:'office'},
        {id: 'title', name: '访问类型',showOverflowTooltip:true},
        {id: 'browser', name: '浏览器'},
        {id: 'os', name: '操作系统',showOverflowTooltip:true},
        {id: 'ip', name: '操作IP'},
        {
          id: 'status',
          name: '请求状态',
          component: {
            id: 'tag',
            getType: (data) => {
              if (data == 'success') {
                return 'success';
              } else {
                return 'danger';
              }
            }
          }, formatter: (data) => {
            if (data == 'success') {
              return '成功';
            } else {
              return '失败';
            }
          }},
        {id: 'costTime', name: '响应时间',unit:'毫秒',width: 80},
        {id: 'createTime', name: '操作时间',width: 150},
        {
          id: 'operation', name: '操作', type: 'button', width:100,children: [
            {text: '详情', permission:'sys_operate_log:view', operation: 'view'},
          ]
        },
      ],
      //查询条件字段
      queryFields: [
        {id: 'companyId', name: '分公司', component:'company-select', colSpan: 6},
        {id: 'endTime', name: '最新日期', component:'datetime-picker', colSpan: 6},
        {id: 'title', name: '访问类型', colSpan: 6},
        {id: 'createUser', name: '操作人', colSpan: 6},
        {id: 'ip', name: '操作IP', colSpan: 6},
        {id: 'browser', name: '浏览器', colSpan: 6},
        {id: 'os', name: '操作系统', colSpan: 6},
        // {id: 'officeRelated', name: '单位相关', colSpan: 6, component: 'data-select',data:[{id:'true',name:'是'},{id:'false',name:'否'}]},
      ],
      infoFields: [{
        id: 'createUser',
        name: '操作人',
        type:'user',
      }, {
        id: 'createTime',
        name: '操作时间',
      }, {
        id: 'title',
        name: '访问类型',
      }, {
        id: 'source',
        name: '数据来源',
      }, {
        id: 'serverIp',
        name: '服务IP',
      }, {
        id: 'serverPort',
        name: '服务端口',
      }, {
        id: 'executeMethod',
        name: '执行方法',
        colSpan:24,
      }, {
        id: 'os',
        name: '操作系统',
      }, {
        id: 'browser',
        name: '浏览器',
      }, {
        id: 'ip',
        name: '用户IP',
      }, {
        id: 'costTime',
        name: '响应时间(毫秒)',
      }, {
        id: 'pageUrl',
        name: '访问页面链接',
        colSpan:24,
      }, {
        id: 'requestData',
        name: '请求数据',
        component: 'textarea',
        colSpan:24,
      }, {
        id: 'responseData',
        name: '返回数据',
        component: 'textarea',
        colSpan:24,
      }],
    }
  },
  computed: {},
  created() {
  },
  watch: {},
  methods: {

  },

}
</script>

